//
//  ViewController.m
//  SYCollectionviewTest
//
//  Created by apple on 2019/1/2.
//  Copyright © 2019 ZMX. All rights reserved.
//

#import "ViewController.h"
#import "SYFormCollectionView.h"


@interface ViewController ()<SYFormCollectionViewDelegate,SYFormColllectionViewDataSource>
/**      **/
@property(nonatomic, strong) SYFormCollectionView *formView;



@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:self.formView.view];
    self.view.frame = CGRectMake(0, 0, kScreen_Size.height, kScreen_Size.width);
    [self.formView formReloadData];
    
}


- (SYFormCollectionView *)formView{
    if (!_formView) {
        _formView = [[SYFormCollectionView alloc] init];
        _formView.delegate = self;
        _formView.dataSource = self;
    }
    return _formView;
}

- (NSUInteger )SYNumberOfSectionsInSYFormCollectionView:(SYFormCollectionView *)formCollectionView{
    return 30;
}
- (NSUInteger )SYFormCollectionView:(SYFormCollectionView *)formCollectionView numberOfItemsInSection:(NSInteger)section{
    return 35;
}

- (CGFloat )SYLeftViewHeightFormCollectionView:(SYFormCollectionView *)formCollectionView{
    return 30.0f;
}


- (CGFloat )SYTopViewWidthFormCollectionView:(SYFormCollectionView *)formCollectionView{
    return 70.0f;
}

- (UIView *)SYCustomUpperLeftCornerView{
    UIView *cornerView = [[UIView alloc] init];
    cornerView.backgroundColor = UIColor.redColor;
    return cornerView;
}

- (CGSize)SYUpperLeftCorner{
    return CGSizeMake(150, 200);
}

- (CGSize )SYContentViewHeightFormCollectionViewLeftView:(SYFormCollectionView *)formCollectionView heightForItemAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.section == 0) {
        if (indexPath.row == 0) {
            return CGSizeMake(70, 31 * 3);
        }
        
        if (indexPath.row == 1 || indexPath.row == 2) {
            return CGSizeMake(70, 0);
        }
    }
    
    
    return CGSizeMake(70, 30);
}


@end
